<script setup>
import { onMounted, ref  } from 'vue';
import axios from 'axios';
import StuList from "@/components/StuList.vue";

const param = ref({
  pageNum: 1,
  pageSize: 12,
});
const page = ref({});
const findAll = async () => {
  const resp = await axios.post('/student/findAll', param.value);
  page.value = resp.data;
};
const handleCurrentPage = (val) => {
  param.value.pageNum = val;
  findAll();
};

onMounted(() => {
  // 调用初始化书籍类型方法
  findAll();
})

</script>


<template>
   <Stu-List :student-list="page.records"
            :current-page="param.pageNum"
            :page-size="param.pageSize"
            :total="page.total"
            @change-page="handleCurrentPage">
    </Stu-List>
</template>

<style scoped>

</style>